<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var o = {
        name:'frank'
    }
    var a = 'name';
   console.log(o[a]);
</script>
</body>
</html>